#if !defined(INFER_COMMON_H_)
#define INFER_COMMON_H_

#include <string>

#include "fixed_array.h"

namespace autodrive {
namespace perception {
constexpr std::int32_t kMaxIONodeShapeSize{8};

/// @brief io node type
enum class IONodeType : std::int8_t {
  /// @brief unknown
  UNKNOWN = 0,
  /// @brief input
  INPUT = 1,
  /// @brief output
  OUTPUT = 2
};

/// @brief dayatype
enum class IONodeDataType : std::int8_t {
  /// @brief 32-bit floating point format.
  kFLOAT = 0,
  ///@brief IEEE 16-bit floating-point format.
  kHALF = 1,
  /// @brief Signed 8-bit integer representing a quantized floating-point value.
  kINT8 = 2,
  /// @brief Signed 32-bit integer format.
  kINT32 = 3,
  /// @brief 8-bit boolean. 0 = false, 1 = true, other values undefined.
  kBOOL = 4,
  /// @brief Unsigned 8-bit integer format.
  kUINT8 = 5,
};

/// @brief
struct IONode {
  /// @brief
  std::string name;
  /// @brief io node type
  IONodeType type;
  /// @brief data type
  IONodeDataType data_type;
  /// @brief scaler bit
  std::int8_t scaler_bit;
  /// @brief shape, [NCHW]
  fixed_array<std::int32_t, kMaxIONodeShapeSize> shape;
  /// @brief data stride
  std::int32_t stride;
  /// @brief host address
  void* host_addr;
  /// @brief device address
  void* dev_addr;
};

}  // namespace perception
}  // namespace autodrive

#endif  // INFER_COMMON_H_
